<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Box2D: b2Body.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="icon.gif"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Box2D
   &#160;<span id="projectnumber">2.2.1</span>
   </div>
   <div id="projectbrief">A 2D Physics Engine for Games</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">b2Body.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org</span>
<a name="l00003"></a>00003 <span class="comment">*</span>
<a name="l00004"></a>00004 <span class="comment">* This software is provided &#39;as-is&#39;, without any express or implied</span>
<a name="l00005"></a>00005 <span class="comment">* warranty.  In no event will the authors be held liable for any damages</span>
<a name="l00006"></a>00006 <span class="comment">* arising from the use of this software.</span>
<a name="l00007"></a>00007 <span class="comment">* Permission is granted to anyone to use this software for any purpose,</span>
<a name="l00008"></a>00008 <span class="comment">* including commercial applications, and to alter it and redistribute it</span>
<a name="l00009"></a>00009 <span class="comment">* freely, subject to the following restrictions:</span>
<a name="l00010"></a>00010 <span class="comment">* 1. The origin of this software must not be misrepresented; you must not</span>
<a name="l00011"></a>00011 <span class="comment">* claim that you wrote the original software. If you use this software</span>
<a name="l00012"></a>00012 <span class="comment">* in a product, an acknowledgment in the product documentation would be</span>
<a name="l00013"></a>00013 <span class="comment">* appreciated but is not required.</span>
<a name="l00014"></a>00014 <span class="comment">* 2. Altered source versions must be plainly marked as such, and must not be</span>
<a name="l00015"></a>00015 <span class="comment">* misrepresented as being the original software.</span>
<a name="l00016"></a>00016 <span class="comment">* 3. This notice may not be removed or altered from any source distribution.</span>
<a name="l00017"></a>00017 <span class="comment">*/</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#ifndef B2_BODY_H</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define B2_BODY_H</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;Box2D/Common/b2Math.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;Box2D/Collision/Shapes/b2Shape.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;memory&gt;</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="keyword">class </span><a class="code" href="classb2_fixture.html">b2Fixture</a>;
<a name="l00027"></a>00027 <span class="keyword">class </span><a class="code" href="classb2_joint.html">b2Joint</a>;
<a name="l00028"></a>00028 <span class="keyword">class </span><a class="code" href="classb2_contact.html">b2Contact</a>;
<a name="l00029"></a>00029 <span class="keyword">class </span>b2Controller;
<a name="l00030"></a>00030 <span class="keyword">class </span><a class="code" href="classb2_world.html">b2World</a>;
<a name="l00031"></a>00031 <span class="keyword">struct </span><a class="code" href="structb2_fixture_def.html">b2FixtureDef</a>;
<a name="l00032"></a>00032 <span class="keyword">struct </span><a class="code" href="structb2_joint_edge.html">b2JointEdge</a>;
<a name="l00033"></a>00033 <span class="keyword">struct </span><a class="code" href="structb2_contact_edge.html">b2ContactEdge</a>;
<a name="l00034"></a>00034 
<a name="l00039"></a>00039 <span class="keyword">enum</span> b2BodyType
<a name="l00040"></a>00040 {
<a name="l00041"></a>00041         b2_staticBody = 0,
<a name="l00042"></a>00042         b2_kinematicBody,
<a name="l00043"></a>00043         b2_dynamicBody
<a name="l00044"></a>00044 
<a name="l00045"></a>00045         <span class="comment">// TODO_ERIN</span>
<a name="l00046"></a>00046         <span class="comment">//b2_bulletBody,</span>
<a name="l00047"></a>00047 };
<a name="l00048"></a>00048 
<a name="l00051"></a><a class="code" href="structb2_body_def.html">00051</a> <span class="keyword">struct </span><a class="code" href="structb2_body_def.html">b2BodyDef</a>
<a name="l00052"></a>00052 {
<a name="l00054"></a><a class="code" href="structb2_body_def.html#a87bee47596b3b3eced0d9dd1f4c18fee">00054</a>         <a class="code" href="structb2_body_def.html#a87bee47596b3b3eced0d9dd1f4c18fee" title="This constructor sets the body definition default values.">b2BodyDef</a>()
<a name="l00055"></a>00055         {
<a name="l00056"></a>00056                 <a class="code" href="structb2_body_def.html#ae457dd1d39be09945eace6061121be29" title="Use this to store application specific body data.">userData</a> = NULL;
<a name="l00057"></a>00057                 <a class="code" href="structb2_body_def.html#a680cadc09ad6cf4b3366cbf0914c648b">position</a>.<a class="code" href="structb2_vec2.html#a4d61640a645e470a50b451307d8e94c3" title="Set this vector to some specified coordinates.">Set</a>(0.0f, 0.0f);
<a name="l00058"></a>00058                 <a class="code" href="structb2_body_def.html#a564b16f4f8e9fcb5dda397e64aa9be6f" title="The world angle of the body in radians.">angle</a> = 0.0f;
<a name="l00059"></a>00059                 <a class="code" href="structb2_body_def.html#a25fa5aa78d93159c344241af95bec2bf" title="The linear velocity of the body&#39;s origin in world co-ordinates.">linearVelocity</a>.<a class="code" href="structb2_vec2.html#a4d61640a645e470a50b451307d8e94c3" title="Set this vector to some specified coordinates.">Set</a>(0.0f, 0.0f);
<a name="l00060"></a>00060                 <a class="code" href="structb2_body_def.html#add7809f7a29656b8c4b643ad8c2f34a9" title="The angular velocity of the body.">angularVelocity</a> = 0.0f;
<a name="l00061"></a>00061                 <a class="code" href="structb2_body_def.html#a728f6df3be7dedb331455105e3659d46">linearDamping</a> = 0.0f;
<a name="l00062"></a>00062                 <a class="code" href="structb2_body_def.html#a01b8dc8ad9f0962efef9e4a8e836feb6">angularDamping</a> = 0.0f;
<a name="l00063"></a>00063                 <a class="code" href="structb2_body_def.html#a0765068172e521ed63cb34084c59c003">allowSleep</a> = <span class="keyword">true</span>;
<a name="l00064"></a>00064                 <a class="code" href="structb2_body_def.html#a17a8102638aac41e7ab94278651a45bd" title="Is this body initially awake or sleeping?">awake</a> = <span class="keyword">true</span>;
<a name="l00065"></a>00065                 <a class="code" href="structb2_body_def.html#a273a51c57440a8884de5939d76b6e3ea" title="Should this body be prevented from rotating? Useful for characters.">fixedRotation</a> = <span class="keyword">false</span>;
<a name="l00066"></a>00066                 <a class="code" href="structb2_body_def.html#a7c0047c9a98a1d20614eeddcdbce7586">bullet</a> = <span class="keyword">false</span>;
<a name="l00067"></a>00067                 <a class="code" href="structb2_body_def.html#a89cc3ad1873908042b002147b3861381">type</a> = b2_staticBody;
<a name="l00068"></a>00068                 <a class="code" href="structb2_body_def.html#adf6f3e9a9e124e080c68bc0edeb170df" title="Does this body start out active?">active</a> = <span class="keyword">true</span>;
<a name="l00069"></a>00069                 <a class="code" href="structb2_body_def.html#aadea3fa173ed1014739ec8b023de4336" title="Scale the gravity applied to this body.">gravityScale</a> = 1.0f;
<a name="l00070"></a>00070         }
<a name="l00071"></a>00071 
<a name="l00074"></a><a class="code" href="structb2_body_def.html#a89cc3ad1873908042b002147b3861381">00074</a>         b2BodyType <a class="code" href="structb2_body_def.html#a89cc3ad1873908042b002147b3861381">type</a>;
<a name="l00075"></a>00075 
<a name="l00078"></a><a class="code" href="structb2_body_def.html#a680cadc09ad6cf4b3366cbf0914c648b">00078</a>         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="structb2_body_def.html#a680cadc09ad6cf4b3366cbf0914c648b">position</a>;
<a name="l00079"></a>00079 
<a name="l00081"></a><a class="code" href="structb2_body_def.html#a564b16f4f8e9fcb5dda397e64aa9be6f">00081</a>         float32 <a class="code" href="structb2_body_def.html#a564b16f4f8e9fcb5dda397e64aa9be6f" title="The world angle of the body in radians.">angle</a>;
<a name="l00082"></a>00082 
<a name="l00084"></a><a class="code" href="structb2_body_def.html#a25fa5aa78d93159c344241af95bec2bf">00084</a>         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="structb2_body_def.html#a25fa5aa78d93159c344241af95bec2bf" title="The linear velocity of the body&#39;s origin in world co-ordinates.">linearVelocity</a>;
<a name="l00085"></a>00085 
<a name="l00087"></a><a class="code" href="structb2_body_def.html#add7809f7a29656b8c4b643ad8c2f34a9">00087</a>         float32 <a class="code" href="structb2_body_def.html#add7809f7a29656b8c4b643ad8c2f34a9" title="The angular velocity of the body.">angularVelocity</a>;
<a name="l00088"></a>00088 
<a name="l00092"></a><a class="code" href="structb2_body_def.html#a728f6df3be7dedb331455105e3659d46">00092</a>         float32 <a class="code" href="structb2_body_def.html#a728f6df3be7dedb331455105e3659d46">linearDamping</a>;
<a name="l00093"></a>00093 
<a name="l00097"></a><a class="code" href="structb2_body_def.html#a01b8dc8ad9f0962efef9e4a8e836feb6">00097</a>         float32 <a class="code" href="structb2_body_def.html#a01b8dc8ad9f0962efef9e4a8e836feb6">angularDamping</a>;
<a name="l00098"></a>00098 
<a name="l00101"></a><a class="code" href="structb2_body_def.html#a0765068172e521ed63cb34084c59c003">00101</a>         <span class="keywordtype">bool</span> <a class="code" href="structb2_body_def.html#a0765068172e521ed63cb34084c59c003">allowSleep</a>;
<a name="l00102"></a>00102 
<a name="l00104"></a><a class="code" href="structb2_body_def.html#a17a8102638aac41e7ab94278651a45bd">00104</a>         <span class="keywordtype">bool</span> <a class="code" href="structb2_body_def.html#a17a8102638aac41e7ab94278651a45bd" title="Is this body initially awake or sleeping?">awake</a>;
<a name="l00105"></a>00105 
<a name="l00107"></a><a class="code" href="structb2_body_def.html#a273a51c57440a8884de5939d76b6e3ea">00107</a>         <span class="keywordtype">bool</span> <a class="code" href="structb2_body_def.html#a273a51c57440a8884de5939d76b6e3ea" title="Should this body be prevented from rotating? Useful for characters.">fixedRotation</a>;
<a name="l00108"></a>00108 
<a name="l00113"></a><a class="code" href="structb2_body_def.html#a7c0047c9a98a1d20614eeddcdbce7586">00113</a>         <span class="keywordtype">bool</span> <a class="code" href="structb2_body_def.html#a7c0047c9a98a1d20614eeddcdbce7586">bullet</a>;
<a name="l00114"></a>00114 
<a name="l00116"></a><a class="code" href="structb2_body_def.html#adf6f3e9a9e124e080c68bc0edeb170df">00116</a>         <span class="keywordtype">bool</span> <a class="code" href="structb2_body_def.html#adf6f3e9a9e124e080c68bc0edeb170df" title="Does this body start out active?">active</a>;
<a name="l00117"></a>00117 
<a name="l00119"></a><a class="code" href="structb2_body_def.html#ae457dd1d39be09945eace6061121be29">00119</a>         <span class="keywordtype">void</span>* <a class="code" href="structb2_body_def.html#ae457dd1d39be09945eace6061121be29" title="Use this to store application specific body data.">userData</a>;
<a name="l00120"></a>00120 
<a name="l00122"></a><a class="code" href="structb2_body_def.html#aadea3fa173ed1014739ec8b023de4336">00122</a>         float32 <a class="code" href="structb2_body_def.html#aadea3fa173ed1014739ec8b023de4336" title="Scale the gravity applied to this body.">gravityScale</a>;
<a name="l00123"></a>00123 };
<a name="l00124"></a>00124 
<a name="l00126"></a><a class="code" href="classb2_body.html">00126</a> <span class="keyword">class </span><a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>
<a name="l00127"></a>00127 {
<a name="l00128"></a>00128 <span class="keyword">public</span>:
<a name="l00136"></a>00136         <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_body.html#aa4892301e9b9d62ede5e93dad1743894">CreateFixture</a>(<span class="keyword">const</span> <a class="code" href="structb2_fixture_def.html">b2FixtureDef</a>* def);
<a name="l00137"></a>00137 
<a name="l00145"></a>00145         <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_body.html#aa4892301e9b9d62ede5e93dad1743894">CreateFixture</a>(<span class="keyword">const</span> <a class="code" href="classb2_shape.html">b2Shape</a>* shape, float32 density);
<a name="l00146"></a>00146 
<a name="l00154"></a>00154         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a856d1df86b7bded91f02d8cfcaea1c2f">DestroyFixture</a>(<a class="code" href="classb2_fixture.html">b2Fixture</a>* fixture);
<a name="l00155"></a>00155 
<a name="l00161"></a>00161         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a4686f32bbce5723761e9719c706eca11">SetTransform</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; position, float32 angle);
<a name="l00162"></a>00162 
<a name="l00165"></a>00165         <span class="keyword">const</span> <a class="code" href="structb2_transform.html">b2Transform</a>&amp; <a class="code" href="classb2_body.html#adaaebca750d0bda56a543884adc5f519">GetTransform</a>() <span class="keyword">const</span>;
<a name="l00166"></a>00166 
<a name="l00169"></a>00169         <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; <a class="code" href="classb2_body.html#a798da9dc2d47431912d991d152b13711">GetPosition</a>() <span class="keyword">const</span>;
<a name="l00170"></a>00170 
<a name="l00173"></a>00173         float32 <a class="code" href="classb2_body.html#a57c4a1946a6dd5a00e28691bc419fdcd">GetAngle</a>() <span class="keyword">const</span>;
<a name="l00174"></a>00174 
<a name="l00176"></a>00176         <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; <a class="code" href="classb2_body.html#a04db0c7b12b315802e58b33884f4f63c" title="Get the world position of the center of mass.">GetWorldCenter</a>() <span class="keyword">const</span>;
<a name="l00177"></a>00177 
<a name="l00179"></a>00179         <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; <a class="code" href="classb2_body.html#a27ed7f8a3b36ddfb01069ee8f7106033" title="Get the local position of the center of mass.">GetLocalCenter</a>() <span class="keyword">const</span>;
<a name="l00180"></a>00180 
<a name="l00183"></a>00183         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a832f3989a44f0d4782c80456832197ad">SetLinearVelocity</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; v);
<a name="l00184"></a>00184 
<a name="l00187"></a>00187         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#ac7f1adfdef7c5c3d89fa44276fae0a5a">GetLinearVelocity</a>() <span class="keyword">const</span>;
<a name="l00188"></a>00188 
<a name="l00191"></a>00191         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a37adc4160b84f73e8552a91cbde3f578">SetAngularVelocity</a>(float32 omega);
<a name="l00192"></a>00192 
<a name="l00195"></a>00195         float32 <a class="code" href="classb2_body.html#a158fe4c141168d2c3e65096b209f548c">GetAngularVelocity</a>() <span class="keyword">const</span>;
<a name="l00196"></a>00196 
<a name="l00202"></a>00202         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#aa1a2ebd027635ea5a81749f267a19261">ApplyForce</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; force, <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; point);
<a name="l00203"></a>00203 
<a name="l00206"></a>00206         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#ab3ede408c7f21b9828119b6b88f268ea">ApplyForceToCenter</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; force);
<a name="l00207"></a>00207 
<a name="l00212"></a>00212         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a2a383c0af1f91f449e74cfcec8fe2604">ApplyTorque</a>(float32 torque);
<a name="l00213"></a>00213 
<a name="l00219"></a>00219         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#ada3c2a70cbb53c4fcee5a4febbbefc15">ApplyLinearImpulse</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; impulse, <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; point);
<a name="l00220"></a>00220 
<a name="l00223"></a>00223         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a2274ca61d7f63babf8fd30348e339083">ApplyAngularImpulse</a>(float32 impulse);
<a name="l00224"></a>00224 
<a name="l00227"></a>00227         float32 <a class="code" href="classb2_body.html#a4f62fea4546d2b9ca64a5f6723bbc71c">GetMass</a>() <span class="keyword">const</span>;
<a name="l00228"></a>00228 
<a name="l00231"></a>00231         float32 <a class="code" href="classb2_body.html#a8c8916caf67c1e618a07d8b6b9253fa8">GetInertia</a>() <span class="keyword">const</span>;
<a name="l00232"></a>00232 
<a name="l00235"></a>00235         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#ad0a90df7e2617a8572cd476267f95417">GetMassData</a>(<a class="code" href="structb2_mass_data.html" title="This holds the mass data computed for a shape.">b2MassData</a>* data) <span class="keyword">const</span>;
<a name="l00236"></a>00236 
<a name="l00242"></a>00242         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a58a641fedf8a81e1e26d09ec00a22fe2">SetMassData</a>(<span class="keyword">const</span> <a class="code" href="structb2_mass_data.html" title="This holds the mass data computed for a shape.">b2MassData</a>* data);
<a name="l00243"></a>00243 
<a name="l00247"></a>00247         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a109d8567c6ae84c61fce2919fb209c63">ResetMassData</a>();
<a name="l00248"></a>00248 
<a name="l00252"></a>00252         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#a8055b90bccb51383caa8c42fbc96c9c3">GetWorldPoint</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; localPoint) <span class="keyword">const</span>;
<a name="l00253"></a>00253 
<a name="l00257"></a>00257         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#afd44622669b5e45202c23e4a212895fc">GetWorldVector</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; localVector) <span class="keyword">const</span>;
<a name="l00258"></a>00258 
<a name="l00262"></a>00262         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#a8f9ef0226b7eb989e700fa8898d29fc0">GetLocalPoint</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; worldPoint) <span class="keyword">const</span>;
<a name="l00263"></a>00263 
<a name="l00267"></a>00267         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#a93de09565c0c1a9da2601c1847aa22df">GetLocalVector</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; worldVector) <span class="keyword">const</span>;
<a name="l00268"></a>00268 
<a name="l00272"></a>00272         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#a4238ae43f5afeb2126b8e8bf765334b5">GetLinearVelocityFromWorldPoint</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; worldPoint) <span class="keyword">const</span>;
<a name="l00273"></a>00273 
<a name="l00277"></a>00277         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#a4429e3f380e882def11c52ac893b8e2e">GetLinearVelocityFromLocalPoint</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; localPoint) <span class="keyword">const</span>;
<a name="l00278"></a>00278 
<a name="l00280"></a>00280         float32 <a class="code" href="classb2_body.html#a7283e4821d24aed0fa5b0f7891175183" title="Get the linear damping of the body.">GetLinearDamping</a>() <span class="keyword">const</span>;
<a name="l00281"></a>00281 
<a name="l00283"></a>00283         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a909f9753ad700f70282a56e00bc182a5" title="Set the linear damping of the body.">SetLinearDamping</a>(float32 linearDamping);
<a name="l00284"></a>00284 
<a name="l00286"></a>00286         float32 <a class="code" href="classb2_body.html#a5153143f2593802c85e54a21de5464ce" title="Get the angular damping of the body.">GetAngularDamping</a>() <span class="keyword">const</span>;
<a name="l00287"></a>00287 
<a name="l00289"></a>00289         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a73a79541b18394fa224d2eae8ad493e8" title="Set the angular damping of the body.">SetAngularDamping</a>(float32 angularDamping);
<a name="l00290"></a>00290 
<a name="l00292"></a>00292         float32 <a class="code" href="classb2_body.html#ad8348f06a391d169d6395dfd66762454" title="Get the gravity scale of the body.">GetGravityScale</a>() <span class="keyword">const</span>;
<a name="l00293"></a>00293 
<a name="l00295"></a>00295         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a8e66a570c2aeee93b29d84cae861a612" title="Set the gravity scale of the body.">SetGravityScale</a>(float32 scale);
<a name="l00296"></a>00296 
<a name="l00298"></a>00298         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a34ff1c84b10b74eb990749a025a1b1ad" title="Set the type of this body. This may alter the mass and velocity.">SetType</a>(b2BodyType type);
<a name="l00299"></a>00299 
<a name="l00301"></a>00301         b2BodyType <a class="code" href="classb2_body.html#aa0d5acad4f0104e709e34e29a4a0c1a4" title="Get the type of this body.">GetType</a>() <span class="keyword">const</span>;
<a name="l00302"></a>00302 
<a name="l00304"></a>00304         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a3253af3725b8d6d63d8223bcd2ddab5c" title="Should this body be treated like a bullet for continuous collision detection?">SetBullet</a>(<span class="keywordtype">bool</span> flag);
<a name="l00305"></a>00305 
<a name="l00307"></a>00307         <span class="keywordtype">bool</span> <a class="code" href="classb2_body.html#af48509b43c9474b394cf76d733b56882" title="Is this body treated like a bullet for continuous collision detection?">IsBullet</a>() <span class="keyword">const</span>;
<a name="l00308"></a>00308 
<a name="l00311"></a>00311         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a229a6de228416203fecbf7a7544c33bb">SetSleepingAllowed</a>(<span class="keywordtype">bool</span> flag);
<a name="l00312"></a>00312 
<a name="l00314"></a>00314         <span class="keywordtype">bool</span> <a class="code" href="classb2_body.html#ac0b0c558008bda8cf7984dbaf2ee3aea" title="Is this body allowed to sleep.">IsSleepingAllowed</a>() <span class="keyword">const</span>;
<a name="l00315"></a>00315 
<a name="l00319"></a>00319         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#ac72ed3df52a26c33db82252ab57399af">SetAwake</a>(<span class="keywordtype">bool</span> flag);
<a name="l00320"></a>00320 
<a name="l00323"></a>00323         <span class="keywordtype">bool</span> <a class="code" href="classb2_body.html#aa28fdb95dffac89d20b04bd1a038b4ea">IsAwake</a>() <span class="keyword">const</span>;
<a name="l00324"></a>00324 
<a name="l00338"></a>00338         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#ab8059b7b3e3b64aee17b54f68f7dde80">SetActive</a>(<span class="keywordtype">bool</span> flag);
<a name="l00339"></a>00339 
<a name="l00341"></a>00341         <span class="keywordtype">bool</span> <a class="code" href="classb2_body.html#ae69b9cb7461ee165b6459ce43d648479" title="Get the active state of the body.">IsActive</a>() <span class="keyword">const</span>;
<a name="l00342"></a>00342 
<a name="l00345"></a>00345         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#aff35078e2a221d2d05409674936cb8d2">SetFixedRotation</a>(<span class="keywordtype">bool</span> flag);
<a name="l00346"></a>00346 
<a name="l00348"></a>00348         <span class="keywordtype">bool</span> <a class="code" href="classb2_body.html#a6bef51a11a1fec3fddad273b11c14214" title="Does this body have fixed rotation?">IsFixedRotation</a>() <span class="keyword">const</span>;
<a name="l00349"></a>00349 
<a name="l00351"></a>00351         <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_body.html#a64634da20c6e0ab2d68a3cc9ea15efc3" title="Get the list of all fixtures attached to this body.">GetFixtureList</a>();
<a name="l00352"></a>00352         <span class="keyword">const</span> <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_body.html#a64634da20c6e0ab2d68a3cc9ea15efc3" title="Get the list of all fixtures attached to this body.">GetFixtureList</a>() <span class="keyword">const</span>;
<a name="l00353"></a>00353 
<a name="l00355"></a>00355         <a class="code" href="structb2_joint_edge.html">b2JointEdge</a>* <a class="code" href="classb2_body.html#a55cf2eb851780599ca5c1f6f25a17e41" title="Get the list of all joints attached to this body.">GetJointList</a>();
<a name="l00356"></a>00356         <span class="keyword">const</span> <a class="code" href="structb2_joint_edge.html">b2JointEdge</a>* <a class="code" href="classb2_body.html#a55cf2eb851780599ca5c1f6f25a17e41" title="Get the list of all joints attached to this body.">GetJointList</a>() <span class="keyword">const</span>;
<a name="l00357"></a>00357 
<a name="l00361"></a>00361         <a class="code" href="structb2_contact_edge.html">b2ContactEdge</a>* <a class="code" href="classb2_body.html#a16bdbfb266c82a0ef51be351a8928bc5">GetContactList</a>();
<a name="l00362"></a>00362         <span class="keyword">const</span> <a class="code" href="structb2_contact_edge.html">b2ContactEdge</a>* <a class="code" href="classb2_body.html#a16bdbfb266c82a0ef51be351a8928bc5">GetContactList</a>() <span class="keyword">const</span>;
<a name="l00363"></a>00363 
<a name="l00365"></a>00365         <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* <a class="code" href="classb2_body.html#ad54182a11d02362b027a0eb072775bdc" title="Get the next body in the world&#39;s body list.">GetNext</a>();
<a name="l00366"></a>00366         <span class="keyword">const</span> <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* <a class="code" href="classb2_body.html#ad54182a11d02362b027a0eb072775bdc" title="Get the next body in the world&#39;s body list.">GetNext</a>() <span class="keyword">const</span>;
<a name="l00367"></a>00367 
<a name="l00369"></a>00369         <span class="keywordtype">void</span>* <a class="code" href="classb2_body.html#a6833f7e2ef1b6ac82641bb6b07ec50d1" title="Get the user data pointer that was provided in the body definition.">GetUserData</a>() <span class="keyword">const</span>;
<a name="l00370"></a>00370 
<a name="l00372"></a>00372         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a5553a5ecdfd2d7200ba2405ce6043f52" title="Set the user data. Use this to store your application specific data.">SetUserData</a>(<span class="keywordtype">void</span>* data);
<a name="l00373"></a>00373 
<a name="l00375"></a>00375         <a class="code" href="classb2_world.html">b2World</a>* <a class="code" href="classb2_body.html#abfd9466763b20977f9122d0e162dfeb9" title="Get the parent world of this body.">GetWorld</a>();
<a name="l00376"></a>00376         <span class="keyword">const</span> <a class="code" href="classb2_world.html">b2World</a>* <a class="code" href="classb2_body.html#abfd9466763b20977f9122d0e162dfeb9" title="Get the parent world of this body.">GetWorld</a>() <span class="keyword">const</span>;
<a name="l00377"></a>00377 
<a name="l00379"></a>00379         <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#ac9e482f7d9df92801c24e79a7e751d06" title="Dump this body to a log file.">Dump</a>();
<a name="l00380"></a>00380 
<a name="l00381"></a>00381 <span class="keyword">private</span>:
<a name="l00382"></a>00382 
<a name="l00383"></a>00383         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_world.html">b2World</a>;
<a name="l00384"></a>00384         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_island.html" title="This is an internal class.">b2Island</a>;
<a name="l00385"></a>00385         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_contact_manager.html">b2ContactManager</a>;
<a name="l00386"></a>00386         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_contact_solver.html">b2ContactSolver</a>;
<a name="l00387"></a>00387         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_contact.html">b2Contact</a>;
<a name="l00388"></a>00388         
<a name="l00389"></a>00389         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_distance_joint.html">b2DistanceJoint</a>;
<a name="l00390"></a>00390         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_gear_joint.html">b2GearJoint</a>;
<a name="l00391"></a>00391         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_wheel_joint.html">b2WheelJoint</a>;
<a name="l00392"></a>00392         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_mouse_joint.html">b2MouseJoint</a>;
<a name="l00393"></a>00393         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_prismatic_joint.html">b2PrismaticJoint</a>;
<a name="l00394"></a>00394         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_pulley_joint.html">b2PulleyJoint</a>;
<a name="l00395"></a>00395         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_revolute_joint.html">b2RevoluteJoint</a>;
<a name="l00396"></a>00396         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_weld_joint.html">b2WeldJoint</a>;
<a name="l00397"></a>00397         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_friction_joint.html">b2FrictionJoint</a>;
<a name="l00398"></a>00398         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_rope_joint.html">b2RopeJoint</a>;
<a name="l00399"></a>00399 
<a name="l00400"></a>00400         <span class="comment">// m_flags</span>
<a name="l00401"></a>00401         <span class="keyword">enum</span>
<a name="l00402"></a>00402         {
<a name="l00403"></a>00403                 e_islandFlag            = 0x0001,
<a name="l00404"></a>00404                 e_awakeFlag                     = 0x0002,
<a name="l00405"></a>00405                 e_autoSleepFlag         = 0x0004,
<a name="l00406"></a>00406                 e_bulletFlag            = 0x0008,
<a name="l00407"></a>00407                 e_fixedRotationFlag     = 0x0010,
<a name="l00408"></a>00408                 e_activeFlag            = 0x0020,
<a name="l00409"></a>00409                 e_toiFlag                       = 0x0040
<a name="l00410"></a>00410         };
<a name="l00411"></a>00411 
<a name="l00412"></a>00412         <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>(<span class="keyword">const</span> <a class="code" href="structb2_body_def.html">b2BodyDef</a>* bd, <a class="code" href="classb2_world.html">b2World</a>* world);
<a name="l00413"></a>00413         ~<a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>();
<a name="l00414"></a>00414 
<a name="l00415"></a>00415         <span class="keywordtype">void</span> SynchronizeFixtures();
<a name="l00416"></a>00416         <span class="keywordtype">void</span> SynchronizeTransform();
<a name="l00417"></a>00417 
<a name="l00418"></a>00418         <span class="comment">// This is used to prevent connected bodies from colliding.</span>
<a name="l00419"></a>00419         <span class="comment">// It may lie, depending on the collideConnected flag.</span>
<a name="l00420"></a>00420         <span class="keywordtype">bool</span> ShouldCollide(<span class="keyword">const</span> <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* other) <span class="keyword">const</span>;
<a name="l00421"></a>00421 
<a name="l00422"></a>00422         <span class="keywordtype">void</span> Advance(float32 t);
<a name="l00423"></a>00423 
<a name="l00424"></a>00424         b2BodyType m_type;
<a name="l00425"></a>00425 
<a name="l00426"></a>00426         uint16 m_flags;
<a name="l00427"></a>00427 
<a name="l00428"></a>00428         int32 m_islandIndex;
<a name="l00429"></a>00429 
<a name="l00430"></a>00430         <a class="code" href="structb2_transform.html">b2Transform</a> m_xf;               <span class="comment">// the body origin transform</span>
<a name="l00431"></a>00431         <a class="code" href="structb2_sweep.html">b2Sweep</a> m_sweep;                <span class="comment">// the swept motion for CCD</span>
<a name="l00432"></a>00432 
<a name="l00433"></a>00433         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> m_linearVelocity;
<a name="l00434"></a>00434         float32 m_angularVelocity;
<a name="l00435"></a>00435 
<a name="l00436"></a>00436         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> m_force;
<a name="l00437"></a>00437         float32 m_torque;
<a name="l00438"></a>00438 
<a name="l00439"></a>00439         <a class="code" href="classb2_world.html">b2World</a>* m_world;
<a name="l00440"></a>00440         <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* m_prev;
<a name="l00441"></a>00441         <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* m_next;
<a name="l00442"></a>00442 
<a name="l00443"></a>00443         <a class="code" href="classb2_fixture.html">b2Fixture</a>* m_fixtureList;
<a name="l00444"></a>00444         int32 m_fixtureCount;
<a name="l00445"></a>00445 
<a name="l00446"></a>00446         <a class="code" href="structb2_joint_edge.html">b2JointEdge</a>* m_jointList;
<a name="l00447"></a>00447         <a class="code" href="structb2_contact_edge.html">b2ContactEdge</a>* m_contactList;
<a name="l00448"></a>00448 
<a name="l00449"></a>00449         float32 m_mass, m_invMass;
<a name="l00450"></a>00450 
<a name="l00451"></a>00451         <span class="comment">// Rotational inertia about the center of mass.</span>
<a name="l00452"></a>00452         float32 m_I, m_invI;
<a name="l00453"></a>00453 
<a name="l00454"></a>00454         float32 m_linearDamping;
<a name="l00455"></a>00455         float32 m_angularDamping;
<a name="l00456"></a>00456         float32 m_gravityScale;
<a name="l00457"></a>00457 
<a name="l00458"></a>00458         float32 m_sleepTime;
<a name="l00459"></a>00459 
<a name="l00460"></a>00460         <span class="keywordtype">void</span>* m_userData;
<a name="l00461"></a>00461 };
<a name="l00462"></a>00462 
<a name="l00463"></a><a class="code" href="classb2_body.html#aa0d5acad4f0104e709e34e29a4a0c1a4">00463</a> <span class="keyword">inline</span> b2BodyType <a class="code" href="classb2_body.html#aa0d5acad4f0104e709e34e29a4a0c1a4" title="Get the type of this body.">b2Body::GetType</a>()<span class="keyword"> const</span>
<a name="l00464"></a>00464 <span class="keyword"></span>{
<a name="l00465"></a>00465         <span class="keywordflow">return</span> m_type;
<a name="l00466"></a>00466 }
<a name="l00467"></a>00467 
<a name="l00468"></a><a class="code" href="classb2_body.html#adaaebca750d0bda56a543884adc5f519">00468</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="structb2_transform.html">b2Transform</a>&amp; <a class="code" href="classb2_body.html#adaaebca750d0bda56a543884adc5f519">b2Body::GetTransform</a>()<span class="keyword"> const</span>
<a name="l00469"></a>00469 <span class="keyword"></span>{
<a name="l00470"></a>00470         <span class="keywordflow">return</span> m_xf;
<a name="l00471"></a>00471 }
<a name="l00472"></a>00472 
<a name="l00473"></a><a class="code" href="classb2_body.html#a798da9dc2d47431912d991d152b13711">00473</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; <a class="code" href="classb2_body.html#a798da9dc2d47431912d991d152b13711">b2Body::GetPosition</a>()<span class="keyword"> const</span>
<a name="l00474"></a>00474 <span class="keyword"></span>{
<a name="l00475"></a>00475         <span class="keywordflow">return</span> m_xf.p;
<a name="l00476"></a>00476 }
<a name="l00477"></a>00477 
<a name="l00478"></a><a class="code" href="classb2_body.html#a57c4a1946a6dd5a00e28691bc419fdcd">00478</a> <span class="keyword">inline</span> float32 <a class="code" href="classb2_body.html#a57c4a1946a6dd5a00e28691bc419fdcd">b2Body::GetAngle</a>()<span class="keyword"> const</span>
<a name="l00479"></a>00479 <span class="keyword"></span>{
<a name="l00480"></a>00480         <span class="keywordflow">return</span> m_sweep.<a class="code" href="structb2_sweep.html#afa96bacc91dd3c92ae716a45512332d6" title="world angles">a</a>;
<a name="l00481"></a>00481 }
<a name="l00482"></a>00482 
<a name="l00483"></a><a class="code" href="classb2_body.html#a04db0c7b12b315802e58b33884f4f63c">00483</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; <a class="code" href="classb2_body.html#a04db0c7b12b315802e58b33884f4f63c" title="Get the world position of the center of mass.">b2Body::GetWorldCenter</a>()<span class="keyword"> const</span>
<a name="l00484"></a>00484 <span class="keyword"></span>{
<a name="l00485"></a>00485         <span class="keywordflow">return</span> m_sweep.<a class="code" href="structb2_sweep.html#a1b5402e01b92cc82473389fc6f0375c3" title="center world positions">c</a>;
<a name="l00486"></a>00486 }
<a name="l00487"></a>00487 
<a name="l00488"></a><a class="code" href="classb2_body.html#a27ed7f8a3b36ddfb01069ee8f7106033">00488</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; <a class="code" href="classb2_body.html#a27ed7f8a3b36ddfb01069ee8f7106033" title="Get the local position of the center of mass.">b2Body::GetLocalCenter</a>()<span class="keyword"> const</span>
<a name="l00489"></a>00489 <span class="keyword"></span>{
<a name="l00490"></a>00490         <span class="keywordflow">return</span> m_sweep.<a class="code" href="structb2_sweep.html#a4bcc302cf78771896d6256fc53f2f8be" title="local center of mass position">localCenter</a>;
<a name="l00491"></a>00491 }
<a name="l00492"></a>00492 
<a name="l00493"></a><a class="code" href="classb2_body.html#a832f3989a44f0d4782c80456832197ad">00493</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a832f3989a44f0d4782c80456832197ad">b2Body::SetLinearVelocity</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; v)
<a name="l00494"></a>00494 {
<a name="l00495"></a>00495         <span class="keywordflow">if</span> (m_type == b2_staticBody)
<a name="l00496"></a>00496         {
<a name="l00497"></a>00497                 <span class="keywordflow">return</span>;
<a name="l00498"></a>00498         }
<a name="l00499"></a>00499 
<a name="l00500"></a>00500         <span class="keywordflow">if</span> (b2Dot(v,v) &gt; 0.0f)
<a name="l00501"></a>00501         {
<a name="l00502"></a>00502                 <a class="code" href="classb2_body.html#ac72ed3df52a26c33db82252ab57399af">SetAwake</a>(<span class="keyword">true</span>);
<a name="l00503"></a>00503         }
<a name="l00504"></a>00504 
<a name="l00505"></a>00505         m_linearVelocity = v;
<a name="l00506"></a>00506 }
<a name="l00507"></a>00507 
<a name="l00508"></a><a class="code" href="classb2_body.html#ac7f1adfdef7c5c3d89fa44276fae0a5a">00508</a> <span class="keyword">inline</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#ac7f1adfdef7c5c3d89fa44276fae0a5a">b2Body::GetLinearVelocity</a>()<span class="keyword"> const</span>
<a name="l00509"></a>00509 <span class="keyword"></span>{
<a name="l00510"></a>00510         <span class="keywordflow">return</span> m_linearVelocity;
<a name="l00511"></a>00511 }
<a name="l00512"></a>00512 
<a name="l00513"></a><a class="code" href="classb2_body.html#a37adc4160b84f73e8552a91cbde3f578">00513</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a37adc4160b84f73e8552a91cbde3f578">b2Body::SetAngularVelocity</a>(float32 w)
<a name="l00514"></a>00514 {
<a name="l00515"></a>00515         <span class="keywordflow">if</span> (m_type == b2_staticBody)
<a name="l00516"></a>00516         {
<a name="l00517"></a>00517                 <span class="keywordflow">return</span>;
<a name="l00518"></a>00518         }
<a name="l00519"></a>00519 
<a name="l00520"></a>00520         <span class="keywordflow">if</span> (w * w &gt; 0.0f)
<a name="l00521"></a>00521         {
<a name="l00522"></a>00522                 <a class="code" href="classb2_body.html#ac72ed3df52a26c33db82252ab57399af">SetAwake</a>(<span class="keyword">true</span>);
<a name="l00523"></a>00523         }
<a name="l00524"></a>00524 
<a name="l00525"></a>00525         m_angularVelocity = w;
<a name="l00526"></a>00526 }
<a name="l00527"></a>00527 
<a name="l00528"></a><a class="code" href="classb2_body.html#a158fe4c141168d2c3e65096b209f548c">00528</a> <span class="keyword">inline</span> float32 <a class="code" href="classb2_body.html#a158fe4c141168d2c3e65096b209f548c">b2Body::GetAngularVelocity</a>()<span class="keyword"> const</span>
<a name="l00529"></a>00529 <span class="keyword"></span>{
<a name="l00530"></a>00530         <span class="keywordflow">return</span> m_angularVelocity;
<a name="l00531"></a>00531 }
<a name="l00532"></a>00532 
<a name="l00533"></a><a class="code" href="classb2_body.html#a4f62fea4546d2b9ca64a5f6723bbc71c">00533</a> <span class="keyword">inline</span> float32 <a class="code" href="classb2_body.html#a4f62fea4546d2b9ca64a5f6723bbc71c">b2Body::GetMass</a>()<span class="keyword"> const</span>
<a name="l00534"></a>00534 <span class="keyword"></span>{
<a name="l00535"></a>00535         <span class="keywordflow">return</span> m_mass;
<a name="l00536"></a>00536 }
<a name="l00537"></a>00537 
<a name="l00538"></a><a class="code" href="classb2_body.html#a8c8916caf67c1e618a07d8b6b9253fa8">00538</a> <span class="keyword">inline</span> float32 <a class="code" href="classb2_body.html#a8c8916caf67c1e618a07d8b6b9253fa8">b2Body::GetInertia</a>()<span class="keyword"> const</span>
<a name="l00539"></a>00539 <span class="keyword"></span>{
<a name="l00540"></a>00540         <span class="keywordflow">return</span> m_I + m_mass * b2Dot(m_sweep.<a class="code" href="structb2_sweep.html#a4bcc302cf78771896d6256fc53f2f8be" title="local center of mass position">localCenter</a>, m_sweep.<a class="code" href="structb2_sweep.html#a4bcc302cf78771896d6256fc53f2f8be" title="local center of mass position">localCenter</a>);
<a name="l00541"></a>00541 }
<a name="l00542"></a>00542 
<a name="l00543"></a><a class="code" href="classb2_body.html#ad0a90df7e2617a8572cd476267f95417">00543</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#ad0a90df7e2617a8572cd476267f95417">b2Body::GetMassData</a>(<a class="code" href="structb2_mass_data.html" title="This holds the mass data computed for a shape.">b2MassData</a>* data)<span class="keyword"> const</span>
<a name="l00544"></a>00544 <span class="keyword"></span>{
<a name="l00545"></a>00545         data-&gt;<a class="code" href="structb2_mass_data.html#aea85d9595a38d2eed05b8d2ea80d97b1" title="The mass of the shape, usually in kilograms.">mass</a> = m_mass;
<a name="l00546"></a>00546         data-&gt;<a class="code" href="structb2_mass_data.html#ad2d06e96e2d79d895df16ae0e5fe0376" title="The rotational inertia of the shape about the local origin.">I</a> = m_I + m_mass * b2Dot(m_sweep.<a class="code" href="structb2_sweep.html#a4bcc302cf78771896d6256fc53f2f8be" title="local center of mass position">localCenter</a>, m_sweep.<a class="code" href="structb2_sweep.html#a4bcc302cf78771896d6256fc53f2f8be" title="local center of mass position">localCenter</a>);
<a name="l00547"></a>00547         data-&gt;<a class="code" href="structb2_mass_data.html#a1d59bebc7030c4dded0c2febc57ebdd7" title="The position of the shape&#39;s centroid relative to the shape&#39;s origin.">center</a> = m_sweep.<a class="code" href="structb2_sweep.html#a4bcc302cf78771896d6256fc53f2f8be" title="local center of mass position">localCenter</a>;
<a name="l00548"></a>00548 }
<a name="l00549"></a>00549 
<a name="l00550"></a><a class="code" href="classb2_body.html#a8055b90bccb51383caa8c42fbc96c9c3">00550</a> <span class="keyword">inline</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#a8055b90bccb51383caa8c42fbc96c9c3">b2Body::GetWorldPoint</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; localPoint)<span class="keyword"> const</span>
<a name="l00551"></a>00551 <span class="keyword"></span>{
<a name="l00552"></a>00552         <span class="keywordflow">return</span> b2Mul(m_xf, localPoint);
<a name="l00553"></a>00553 }
<a name="l00554"></a>00554 
<a name="l00555"></a><a class="code" href="classb2_body.html#afd44622669b5e45202c23e4a212895fc">00555</a> <span class="keyword">inline</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#afd44622669b5e45202c23e4a212895fc">b2Body::GetWorldVector</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; localVector)<span class="keyword"> const</span>
<a name="l00556"></a>00556 <span class="keyword"></span>{
<a name="l00557"></a>00557         <span class="keywordflow">return</span> b2Mul(m_xf.q, localVector);
<a name="l00558"></a>00558 }
<a name="l00559"></a>00559 
<a name="l00560"></a><a class="code" href="classb2_body.html#a8f9ef0226b7eb989e700fa8898d29fc0">00560</a> <span class="keyword">inline</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#a8f9ef0226b7eb989e700fa8898d29fc0">b2Body::GetLocalPoint</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; worldPoint)<span class="keyword"> const</span>
<a name="l00561"></a>00561 <span class="keyword"></span>{
<a name="l00562"></a>00562         <span class="keywordflow">return</span> b2MulT(m_xf, worldPoint);
<a name="l00563"></a>00563 }
<a name="l00564"></a>00564 
<a name="l00565"></a><a class="code" href="classb2_body.html#a93de09565c0c1a9da2601c1847aa22df">00565</a> <span class="keyword">inline</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#a93de09565c0c1a9da2601c1847aa22df">b2Body::GetLocalVector</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; worldVector)<span class="keyword"> const</span>
<a name="l00566"></a>00566 <span class="keyword"></span>{
<a name="l00567"></a>00567         <span class="keywordflow">return</span> b2MulT(m_xf.q, worldVector);
<a name="l00568"></a>00568 }
<a name="l00569"></a>00569 
<a name="l00570"></a><a class="code" href="classb2_body.html#a4238ae43f5afeb2126b8e8bf765334b5">00570</a> <span class="keyword">inline</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#a4238ae43f5afeb2126b8e8bf765334b5">b2Body::GetLinearVelocityFromWorldPoint</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; worldPoint)<span class="keyword"> const</span>
<a name="l00571"></a>00571 <span class="keyword"></span>{
<a name="l00572"></a>00572         <span class="keywordflow">return</span> m_linearVelocity + b2Cross(m_angularVelocity, worldPoint - m_sweep.<a class="code" href="structb2_sweep.html#a1b5402e01b92cc82473389fc6f0375c3" title="center world positions">c</a>);
<a name="l00573"></a>00573 }
<a name="l00574"></a>00574 
<a name="l00575"></a><a class="code" href="classb2_body.html#a4429e3f380e882def11c52ac893b8e2e">00575</a> <span class="keyword">inline</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_body.html#a4429e3f380e882def11c52ac893b8e2e">b2Body::GetLinearVelocityFromLocalPoint</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; localPoint)<span class="keyword"> const</span>
<a name="l00576"></a>00576 <span class="keyword"></span>{
<a name="l00577"></a>00577         <span class="keywordflow">return</span> <a class="code" href="classb2_body.html#a4238ae43f5afeb2126b8e8bf765334b5">GetLinearVelocityFromWorldPoint</a>(<a class="code" href="classb2_body.html#a8055b90bccb51383caa8c42fbc96c9c3">GetWorldPoint</a>(localPoint));
<a name="l00578"></a>00578 }
<a name="l00579"></a>00579 
<a name="l00580"></a><a class="code" href="classb2_body.html#a7283e4821d24aed0fa5b0f7891175183">00580</a> <span class="keyword">inline</span> float32 <a class="code" href="classb2_body.html#a7283e4821d24aed0fa5b0f7891175183" title="Get the linear damping of the body.">b2Body::GetLinearDamping</a>()<span class="keyword"> const</span>
<a name="l00581"></a>00581 <span class="keyword"></span>{
<a name="l00582"></a>00582         <span class="keywordflow">return</span> m_linearDamping;
<a name="l00583"></a>00583 }
<a name="l00584"></a>00584 
<a name="l00585"></a><a class="code" href="classb2_body.html#a909f9753ad700f70282a56e00bc182a5">00585</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a909f9753ad700f70282a56e00bc182a5" title="Set the linear damping of the body.">b2Body::SetLinearDamping</a>(float32 linearDamping)
<a name="l00586"></a>00586 {
<a name="l00587"></a>00587         m_linearDamping = linearDamping;
<a name="l00588"></a>00588 }
<a name="l00589"></a>00589 
<a name="l00590"></a><a class="code" href="classb2_body.html#a5153143f2593802c85e54a21de5464ce">00590</a> <span class="keyword">inline</span> float32 <a class="code" href="classb2_body.html#a5153143f2593802c85e54a21de5464ce" title="Get the angular damping of the body.">b2Body::GetAngularDamping</a>()<span class="keyword"> const</span>
<a name="l00591"></a>00591 <span class="keyword"></span>{
<a name="l00592"></a>00592         <span class="keywordflow">return</span> m_angularDamping;
<a name="l00593"></a>00593 }
<a name="l00594"></a>00594 
<a name="l00595"></a><a class="code" href="classb2_body.html#a73a79541b18394fa224d2eae8ad493e8">00595</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a73a79541b18394fa224d2eae8ad493e8" title="Set the angular damping of the body.">b2Body::SetAngularDamping</a>(float32 angularDamping)
<a name="l00596"></a>00596 {
<a name="l00597"></a>00597         m_angularDamping = angularDamping;
<a name="l00598"></a>00598 }
<a name="l00599"></a>00599 
<a name="l00600"></a><a class="code" href="classb2_body.html#ad8348f06a391d169d6395dfd66762454">00600</a> <span class="keyword">inline</span> float32 <a class="code" href="classb2_body.html#ad8348f06a391d169d6395dfd66762454" title="Get the gravity scale of the body.">b2Body::GetGravityScale</a>()<span class="keyword"> const</span>
<a name="l00601"></a>00601 <span class="keyword"></span>{
<a name="l00602"></a>00602         <span class="keywordflow">return</span> m_gravityScale;
<a name="l00603"></a>00603 }
<a name="l00604"></a>00604 
<a name="l00605"></a><a class="code" href="classb2_body.html#a8e66a570c2aeee93b29d84cae861a612">00605</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a8e66a570c2aeee93b29d84cae861a612" title="Set the gravity scale of the body.">b2Body::SetGravityScale</a>(float32 scale)
<a name="l00606"></a>00606 {
<a name="l00607"></a>00607         m_gravityScale = scale;
<a name="l00608"></a>00608 }
<a name="l00609"></a>00609 
<a name="l00610"></a><a class="code" href="classb2_body.html#a3253af3725b8d6d63d8223bcd2ddab5c">00610</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a3253af3725b8d6d63d8223bcd2ddab5c" title="Should this body be treated like a bullet for continuous collision detection?">b2Body::SetBullet</a>(<span class="keywordtype">bool</span> flag)
<a name="l00611"></a>00611 {
<a name="l00612"></a>00612         <span class="keywordflow">if</span> (flag)
<a name="l00613"></a>00613         {
<a name="l00614"></a>00614                 m_flags |= e_bulletFlag;
<a name="l00615"></a>00615         }
<a name="l00616"></a>00616         <span class="keywordflow">else</span>
<a name="l00617"></a>00617         {
<a name="l00618"></a>00618                 m_flags &amp;= ~e_bulletFlag;
<a name="l00619"></a>00619         }
<a name="l00620"></a>00620 }
<a name="l00621"></a>00621 
<a name="l00622"></a><a class="code" href="classb2_body.html#af48509b43c9474b394cf76d733b56882">00622</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classb2_body.html#af48509b43c9474b394cf76d733b56882" title="Is this body treated like a bullet for continuous collision detection?">b2Body::IsBullet</a>()<span class="keyword"> const</span>
<a name="l00623"></a>00623 <span class="keyword"></span>{
<a name="l00624"></a>00624         <span class="keywordflow">return</span> (m_flags &amp; e_bulletFlag) == e_bulletFlag;
<a name="l00625"></a>00625 }
<a name="l00626"></a>00626 
<a name="l00627"></a><a class="code" href="classb2_body.html#ac72ed3df52a26c33db82252ab57399af">00627</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#ac72ed3df52a26c33db82252ab57399af">b2Body::SetAwake</a>(<span class="keywordtype">bool</span> flag)
<a name="l00628"></a>00628 {
<a name="l00629"></a>00629         <span class="keywordflow">if</span> (flag)
<a name="l00630"></a>00630         {
<a name="l00631"></a>00631                 <span class="keywordflow">if</span> ((m_flags &amp; e_awakeFlag) == 0)
<a name="l00632"></a>00632                 {
<a name="l00633"></a>00633                         m_flags |= e_awakeFlag;
<a name="l00634"></a>00634                         m_sleepTime = 0.0f;
<a name="l00635"></a>00635                 }
<a name="l00636"></a>00636         }
<a name="l00637"></a>00637         <span class="keywordflow">else</span>
<a name="l00638"></a>00638         {
<a name="l00639"></a>00639                 m_flags &amp;= ~e_awakeFlag;
<a name="l00640"></a>00640                 m_sleepTime = 0.0f;
<a name="l00641"></a>00641                 m_linearVelocity.<a class="code" href="structb2_vec2.html#a5c6cbe27cfb29c6dbb29b9a3285b88d0" title="Set this vector to all zeros.">SetZero</a>();
<a name="l00642"></a>00642                 m_angularVelocity = 0.0f;
<a name="l00643"></a>00643                 m_force.<a class="code" href="structb2_vec2.html#a5c6cbe27cfb29c6dbb29b9a3285b88d0" title="Set this vector to all zeros.">SetZero</a>();
<a name="l00644"></a>00644                 m_torque = 0.0f;
<a name="l00645"></a>00645         }
<a name="l00646"></a>00646 }
<a name="l00647"></a>00647 
<a name="l00648"></a><a class="code" href="classb2_body.html#aa28fdb95dffac89d20b04bd1a038b4ea">00648</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classb2_body.html#aa28fdb95dffac89d20b04bd1a038b4ea">b2Body::IsAwake</a>()<span class="keyword"> const</span>
<a name="l00649"></a>00649 <span class="keyword"></span>{
<a name="l00650"></a>00650         <span class="keywordflow">return</span> (m_flags &amp; e_awakeFlag) == e_awakeFlag;
<a name="l00651"></a>00651 }
<a name="l00652"></a>00652 
<a name="l00653"></a><a class="code" href="classb2_body.html#ae69b9cb7461ee165b6459ce43d648479">00653</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classb2_body.html#ae69b9cb7461ee165b6459ce43d648479" title="Get the active state of the body.">b2Body::IsActive</a>()<span class="keyword"> const</span>
<a name="l00654"></a>00654 <span class="keyword"></span>{
<a name="l00655"></a>00655         <span class="keywordflow">return</span> (m_flags &amp; e_activeFlag) == e_activeFlag;
<a name="l00656"></a>00656 }
<a name="l00657"></a>00657 
<a name="l00658"></a><a class="code" href="classb2_body.html#aff35078e2a221d2d05409674936cb8d2">00658</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#aff35078e2a221d2d05409674936cb8d2">b2Body::SetFixedRotation</a>(<span class="keywordtype">bool</span> flag)
<a name="l00659"></a>00659 {
<a name="l00660"></a>00660         <span class="keywordflow">if</span> (flag)
<a name="l00661"></a>00661         {
<a name="l00662"></a>00662                 m_flags |= e_fixedRotationFlag;
<a name="l00663"></a>00663         }
<a name="l00664"></a>00664         <span class="keywordflow">else</span>
<a name="l00665"></a>00665         {
<a name="l00666"></a>00666                 m_flags &amp;= ~e_fixedRotationFlag;
<a name="l00667"></a>00667         }
<a name="l00668"></a>00668 
<a name="l00669"></a>00669         <a class="code" href="classb2_body.html#a109d8567c6ae84c61fce2919fb209c63">ResetMassData</a>();
<a name="l00670"></a>00670 }
<a name="l00671"></a>00671 
<a name="l00672"></a><a class="code" href="classb2_body.html#a6bef51a11a1fec3fddad273b11c14214">00672</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classb2_body.html#a6bef51a11a1fec3fddad273b11c14214" title="Does this body have fixed rotation?">b2Body::IsFixedRotation</a>()<span class="keyword"> const</span>
<a name="l00673"></a>00673 <span class="keyword"></span>{
<a name="l00674"></a>00674         <span class="keywordflow">return</span> (m_flags &amp; e_fixedRotationFlag) == e_fixedRotationFlag;
<a name="l00675"></a>00675 }
<a name="l00676"></a>00676 
<a name="l00677"></a><a class="code" href="classb2_body.html#a229a6de228416203fecbf7a7544c33bb">00677</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a229a6de228416203fecbf7a7544c33bb">b2Body::SetSleepingAllowed</a>(<span class="keywordtype">bool</span> flag)
<a name="l00678"></a>00678 {
<a name="l00679"></a>00679         <span class="keywordflow">if</span> (flag)
<a name="l00680"></a>00680         {
<a name="l00681"></a>00681                 m_flags |= e_autoSleepFlag;
<a name="l00682"></a>00682         }
<a name="l00683"></a>00683         <span class="keywordflow">else</span>
<a name="l00684"></a>00684         {
<a name="l00685"></a>00685                 m_flags &amp;= ~e_autoSleepFlag;
<a name="l00686"></a>00686                 <a class="code" href="classb2_body.html#ac72ed3df52a26c33db82252ab57399af">SetAwake</a>(<span class="keyword">true</span>);
<a name="l00687"></a>00687         }
<a name="l00688"></a>00688 }
<a name="l00689"></a>00689 
<a name="l00690"></a><a class="code" href="classb2_body.html#ac0b0c558008bda8cf7984dbaf2ee3aea">00690</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classb2_body.html#ac0b0c558008bda8cf7984dbaf2ee3aea" title="Is this body allowed to sleep.">b2Body::IsSleepingAllowed</a>()<span class="keyword"> const</span>
<a name="l00691"></a>00691 <span class="keyword"></span>{
<a name="l00692"></a>00692         <span class="keywordflow">return</span> (m_flags &amp; e_autoSleepFlag) == e_autoSleepFlag;
<a name="l00693"></a>00693 }
<a name="l00694"></a>00694 
<a name="l00695"></a><a class="code" href="classb2_body.html#a64634da20c6e0ab2d68a3cc9ea15efc3">00695</a> <span class="keyword">inline</span> <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_body.html#a64634da20c6e0ab2d68a3cc9ea15efc3" title="Get the list of all fixtures attached to this body.">b2Body::GetFixtureList</a>()
<a name="l00696"></a>00696 {
<a name="l00697"></a>00697         <span class="keywordflow">return</span> m_fixtureList;
<a name="l00698"></a>00698 }
<a name="l00699"></a>00699 
<a name="l00700"></a>00700 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_body.html#a64634da20c6e0ab2d68a3cc9ea15efc3" title="Get the list of all fixtures attached to this body.">b2Body::GetFixtureList</a>()<span class="keyword"> const</span>
<a name="l00701"></a>00701 <span class="keyword"></span>{
<a name="l00702"></a>00702         <span class="keywordflow">return</span> m_fixtureList;
<a name="l00703"></a>00703 }
<a name="l00704"></a>00704 
<a name="l00705"></a><a class="code" href="classb2_body.html#a55cf2eb851780599ca5c1f6f25a17e41">00705</a> <span class="keyword">inline</span> <a class="code" href="structb2_joint_edge.html">b2JointEdge</a>* <a class="code" href="classb2_body.html#a55cf2eb851780599ca5c1f6f25a17e41" title="Get the list of all joints attached to this body.">b2Body::GetJointList</a>()
<a name="l00706"></a>00706 {
<a name="l00707"></a>00707         <span class="keywordflow">return</span> m_jointList;
<a name="l00708"></a>00708 }
<a name="l00709"></a>00709 
<a name="l00710"></a>00710 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="structb2_joint_edge.html">b2JointEdge</a>* <a class="code" href="classb2_body.html#a55cf2eb851780599ca5c1f6f25a17e41" title="Get the list of all joints attached to this body.">b2Body::GetJointList</a>()<span class="keyword"> const</span>
<a name="l00711"></a>00711 <span class="keyword"></span>{
<a name="l00712"></a>00712         <span class="keywordflow">return</span> m_jointList;
<a name="l00713"></a>00713 }
<a name="l00714"></a>00714 
<a name="l00715"></a><a class="code" href="classb2_body.html#a16bdbfb266c82a0ef51be351a8928bc5">00715</a> <span class="keyword">inline</span> <a class="code" href="structb2_contact_edge.html">b2ContactEdge</a>* <a class="code" href="classb2_body.html#a16bdbfb266c82a0ef51be351a8928bc5">b2Body::GetContactList</a>()
<a name="l00716"></a>00716 {
<a name="l00717"></a>00717         <span class="keywordflow">return</span> m_contactList;
<a name="l00718"></a>00718 }
<a name="l00719"></a>00719 
<a name="l00720"></a>00720 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="structb2_contact_edge.html">b2ContactEdge</a>* <a class="code" href="classb2_body.html#a16bdbfb266c82a0ef51be351a8928bc5">b2Body::GetContactList</a>()<span class="keyword"> const</span>
<a name="l00721"></a>00721 <span class="keyword"></span>{
<a name="l00722"></a>00722         <span class="keywordflow">return</span> m_contactList;
<a name="l00723"></a>00723 }
<a name="l00724"></a>00724 
<a name="l00725"></a><a class="code" href="classb2_body.html#ad54182a11d02362b027a0eb072775bdc">00725</a> <span class="keyword">inline</span> <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* <a class="code" href="classb2_body.html#ad54182a11d02362b027a0eb072775bdc" title="Get the next body in the world&#39;s body list.">b2Body::GetNext</a>()
<a name="l00726"></a>00726 {
<a name="l00727"></a>00727         <span class="keywordflow">return</span> m_next;
<a name="l00728"></a>00728 }
<a name="l00729"></a>00729 
<a name="l00730"></a>00730 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* <a class="code" href="classb2_body.html#ad54182a11d02362b027a0eb072775bdc" title="Get the next body in the world&#39;s body list.">b2Body::GetNext</a>()<span class="keyword"> const</span>
<a name="l00731"></a>00731 <span class="keyword"></span>{
<a name="l00732"></a>00732         <span class="keywordflow">return</span> m_next;
<a name="l00733"></a>00733 }
<a name="l00734"></a>00734 
<a name="l00735"></a><a class="code" href="classb2_body.html#a5553a5ecdfd2d7200ba2405ce6043f52">00735</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a5553a5ecdfd2d7200ba2405ce6043f52" title="Set the user data. Use this to store your application specific data.">b2Body::SetUserData</a>(<span class="keywordtype">void</span>* data)
<a name="l00736"></a>00736 {
<a name="l00737"></a>00737         m_userData = data;
<a name="l00738"></a>00738 }
<a name="l00739"></a>00739 
<a name="l00740"></a><a class="code" href="classb2_body.html#a6833f7e2ef1b6ac82641bb6b07ec50d1">00740</a> <span class="keyword">inline</span> <span class="keywordtype">void</span>* <a class="code" href="classb2_body.html#a6833f7e2ef1b6ac82641bb6b07ec50d1" title="Get the user data pointer that was provided in the body definition.">b2Body::GetUserData</a>()<span class="keyword"> const</span>
<a name="l00741"></a>00741 <span class="keyword"></span>{
<a name="l00742"></a>00742         <span class="keywordflow">return</span> m_userData;
<a name="l00743"></a>00743 }
<a name="l00744"></a>00744 
<a name="l00745"></a><a class="code" href="classb2_body.html#aa1a2ebd027635ea5a81749f267a19261">00745</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#aa1a2ebd027635ea5a81749f267a19261">b2Body::ApplyForce</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; force, <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; point)
<a name="l00746"></a>00746 {
<a name="l00747"></a>00747         <span class="keywordflow">if</span> (m_type != b2_dynamicBody)
<a name="l00748"></a>00748         {
<a name="l00749"></a>00749                 <span class="keywordflow">return</span>;
<a name="l00750"></a>00750         }
<a name="l00751"></a>00751 
<a name="l00752"></a>00752         <span class="keywordflow">if</span> (<a class="code" href="classb2_body.html#aa28fdb95dffac89d20b04bd1a038b4ea">IsAwake</a>() == <span class="keyword">false</span>)
<a name="l00753"></a>00753         {
<a name="l00754"></a>00754                 <a class="code" href="classb2_body.html#ac72ed3df52a26c33db82252ab57399af">SetAwake</a>(<span class="keyword">true</span>);
<a name="l00755"></a>00755         }
<a name="l00756"></a>00756 
<a name="l00757"></a>00757         m_force += force;
<a name="l00758"></a>00758         m_torque += b2Cross(point - m_sweep.<a class="code" href="structb2_sweep.html#a1b5402e01b92cc82473389fc6f0375c3" title="center world positions">c</a>, force);
<a name="l00759"></a>00759 }
<a name="l00760"></a>00760 
<a name="l00761"></a><a class="code" href="classb2_body.html#ab3ede408c7f21b9828119b6b88f268ea">00761</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#ab3ede408c7f21b9828119b6b88f268ea">b2Body::ApplyForceToCenter</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; force)
<a name="l00762"></a>00762 {
<a name="l00763"></a>00763         <span class="keywordflow">if</span> (m_type != b2_dynamicBody)
<a name="l00764"></a>00764         {
<a name="l00765"></a>00765                 <span class="keywordflow">return</span>;
<a name="l00766"></a>00766         }
<a name="l00767"></a>00767 
<a name="l00768"></a>00768         <span class="keywordflow">if</span> (<a class="code" href="classb2_body.html#aa28fdb95dffac89d20b04bd1a038b4ea">IsAwake</a>() == <span class="keyword">false</span>)
<a name="l00769"></a>00769         {
<a name="l00770"></a>00770                 <a class="code" href="classb2_body.html#ac72ed3df52a26c33db82252ab57399af">SetAwake</a>(<span class="keyword">true</span>);
<a name="l00771"></a>00771         }
<a name="l00772"></a>00772 
<a name="l00773"></a>00773         m_force += force;
<a name="l00774"></a>00774 }
<a name="l00775"></a>00775 
<a name="l00776"></a><a class="code" href="classb2_body.html#a2a383c0af1f91f449e74cfcec8fe2604">00776</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a2a383c0af1f91f449e74cfcec8fe2604">b2Body::ApplyTorque</a>(float32 torque)
<a name="l00777"></a>00777 {
<a name="l00778"></a>00778         <span class="keywordflow">if</span> (m_type != b2_dynamicBody)
<a name="l00779"></a>00779         {
<a name="l00780"></a>00780                 <span class="keywordflow">return</span>;
<a name="l00781"></a>00781         }
<a name="l00782"></a>00782 
<a name="l00783"></a>00783         <span class="keywordflow">if</span> (<a class="code" href="classb2_body.html#aa28fdb95dffac89d20b04bd1a038b4ea">IsAwake</a>() == <span class="keyword">false</span>)
<a name="l00784"></a>00784         {
<a name="l00785"></a>00785                 <a class="code" href="classb2_body.html#ac72ed3df52a26c33db82252ab57399af">SetAwake</a>(<span class="keyword">true</span>);
<a name="l00786"></a>00786         }
<a name="l00787"></a>00787 
<a name="l00788"></a>00788         m_torque += torque;
<a name="l00789"></a>00789 }
<a name="l00790"></a>00790 
<a name="l00791"></a><a class="code" href="classb2_body.html#ada3c2a70cbb53c4fcee5a4febbbefc15">00791</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#ada3c2a70cbb53c4fcee5a4febbbefc15">b2Body::ApplyLinearImpulse</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; impulse, <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; point)
<a name="l00792"></a>00792 {
<a name="l00793"></a>00793         <span class="keywordflow">if</span> (m_type != b2_dynamicBody)
<a name="l00794"></a>00794         {
<a name="l00795"></a>00795                 <span class="keywordflow">return</span>;
<a name="l00796"></a>00796         }
<a name="l00797"></a>00797 
<a name="l00798"></a>00798         <span class="keywordflow">if</span> (<a class="code" href="classb2_body.html#aa28fdb95dffac89d20b04bd1a038b4ea">IsAwake</a>() == <span class="keyword">false</span>)
<a name="l00799"></a>00799         {
<a name="l00800"></a>00800                 <a class="code" href="classb2_body.html#ac72ed3df52a26c33db82252ab57399af">SetAwake</a>(<span class="keyword">true</span>);
<a name="l00801"></a>00801         }
<a name="l00802"></a>00802         m_linearVelocity += m_invMass * impulse;
<a name="l00803"></a>00803         m_angularVelocity += m_invI * b2Cross(point - m_sweep.<a class="code" href="structb2_sweep.html#a1b5402e01b92cc82473389fc6f0375c3" title="center world positions">c</a>, impulse);
<a name="l00804"></a>00804 }
<a name="l00805"></a>00805 
<a name="l00806"></a><a class="code" href="classb2_body.html#a2274ca61d7f63babf8fd30348e339083">00806</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_body.html#a2274ca61d7f63babf8fd30348e339083">b2Body::ApplyAngularImpulse</a>(float32 impulse)
<a name="l00807"></a>00807 {
<a name="l00808"></a>00808         <span class="keywordflow">if</span> (m_type != b2_dynamicBody)
<a name="l00809"></a>00809         {
<a name="l00810"></a>00810                 <span class="keywordflow">return</span>;
<a name="l00811"></a>00811         }
<a name="l00812"></a>00812 
<a name="l00813"></a>00813         <span class="keywordflow">if</span> (<a class="code" href="classb2_body.html#aa28fdb95dffac89d20b04bd1a038b4ea">IsAwake</a>() == <span class="keyword">false</span>)
<a name="l00814"></a>00814         {
<a name="l00815"></a>00815                 <a class="code" href="classb2_body.html#ac72ed3df52a26c33db82252ab57399af">SetAwake</a>(<span class="keyword">true</span>);
<a name="l00816"></a>00816         }
<a name="l00817"></a>00817         m_angularVelocity += m_invI * impulse;
<a name="l00818"></a>00818 }
<a name="l00819"></a>00819 
<a name="l00820"></a>00820 <span class="keyword">inline</span> <span class="keywordtype">void</span> b2Body::SynchronizeTransform()
<a name="l00821"></a>00821 {
<a name="l00822"></a>00822         m_xf.q.<a class="code" href="structb2_rot.html#acde9186de0a4a7397bf8ef714408ad60" title="Set using an angle in radians.">Set</a>(m_sweep.<a class="code" href="structb2_sweep.html#afa96bacc91dd3c92ae716a45512332d6" title="world angles">a</a>);
<a name="l00823"></a>00823         m_xf.p = m_sweep.<a class="code" href="structb2_sweep.html#a1b5402e01b92cc82473389fc6f0375c3" title="center world positions">c</a> - b2Mul(m_xf.q, m_sweep.<a class="code" href="structb2_sweep.html#a4bcc302cf78771896d6256fc53f2f8be" title="local center of mass position">localCenter</a>);
<a name="l00824"></a>00824 }
<a name="l00825"></a>00825 
<a name="l00826"></a>00826 <span class="keyword">inline</span> <span class="keywordtype">void</span> b2Body::Advance(float32 alpha)
<a name="l00827"></a>00827 {
<a name="l00828"></a>00828         <span class="comment">// Advance to the new safe time. This doesn&#39;t sync the broad-phase.</span>
<a name="l00829"></a>00829         m_sweep.<a class="code" href="structb2_sweep.html#a35eb9b976ca87c9b8d758bec070c6c06">Advance</a>(alpha);
<a name="l00830"></a>00830         m_sweep.<a class="code" href="structb2_sweep.html#a1b5402e01b92cc82473389fc6f0375c3" title="center world positions">c</a> = m_sweep.c0;
<a name="l00831"></a>00831         m_sweep.<a class="code" href="structb2_sweep.html#afa96bacc91dd3c92ae716a45512332d6" title="world angles">a</a> = m_sweep.a0;
<a name="l00832"></a>00832         m_xf.q.<a class="code" href="structb2_rot.html#acde9186de0a4a7397bf8ef714408ad60" title="Set using an angle in radians.">Set</a>(m_sweep.<a class="code" href="structb2_sweep.html#afa96bacc91dd3c92ae716a45512332d6" title="world angles">a</a>);
<a name="l00833"></a>00833         m_xf.p = m_sweep.<a class="code" href="structb2_sweep.html#a1b5402e01b92cc82473389fc6f0375c3" title="center world positions">c</a> - b2Mul(m_xf.q, m_sweep.<a class="code" href="structb2_sweep.html#a4bcc302cf78771896d6256fc53f2f8be" title="local center of mass position">localCenter</a>);
<a name="l00834"></a>00834 }
<a name="l00835"></a>00835 
<a name="l00836"></a><a class="code" href="classb2_body.html#abfd9466763b20977f9122d0e162dfeb9">00836</a> <span class="keyword">inline</span> <a class="code" href="classb2_world.html">b2World</a>* <a class="code" href="classb2_body.html#abfd9466763b20977f9122d0e162dfeb9" title="Get the parent world of this body.">b2Body::GetWorld</a>()
<a name="l00837"></a>00837 {
<a name="l00838"></a>00838         <span class="keywordflow">return</span> m_world;
<a name="l00839"></a>00839 }
<a name="l00840"></a>00840 
<a name="l00841"></a>00841 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classb2_world.html">b2World</a>* <a class="code" href="classb2_body.html#abfd9466763b20977f9122d0e162dfeb9" title="Get the parent world of this body.">b2Body::GetWorld</a>()<span class="keyword"> const</span>
<a name="l00842"></a>00842 <span class="keyword"></span>{
<a name="l00843"></a>00843         <span class="keywordflow">return</span> m_world;
<a name="l00844"></a>00844 }
<a name="l00845"></a>00845 
<a name="l00846"></a>00846 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Sat Sep 17 2011 17:35:54 for Box2D by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
